<template>
  <div class="home-header">
    <router-link to="/adress">
      <div class="header-left">{{ cityInfo.name || "手动定位" }}</div>
    </router-link>
    <div class="header-right" @click="serachShop">店铺/品类/商圈</div>
  </div>
</template>

<script>
export default {
  props: {
    cityInfo: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  methods: {
    serachShop() {
      this.$router.push("/shop/search");
    },
  },
};
</script>

<style lang="scss" scoped>
.home-header {
  width: 100%;
  height: 2.906667rem;
  background-image: linear-gradient(180deg, #50b8fd, #f5f5f5);
  display: flex;
  justify-content: flex-start;
  overflow: hidden;
  .header-left {
    font-size: 0.373333rem;
    color: #fff;
    margin-left: 0.293333rem;
    margin-top: 0.466667rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    width: 2.666667rem;
    &::after {
      content: "";
      display: inline-block;
      width: 0.4rem;
      height: 0.24rem;
      background: url("../../static/img/arrow.png") no-repeat center;
      background-size: contain;
      vertical-align: middle;
      margin-left: 0.186667rem;
    }
  }
  .header-right {
    flex: 1;
    height: 0.8rem;
    line-height: 0.8rem;
    background-color: #fff;
    padding-left: 0.533333rem;
    border-radius: 0.4rem;
    margin-top: 0.333333rem;
    font-size: 0.346667rem;
    color: #999;
    margin-right: 0.533333rem;
    &::before {
      content: "";
      display: inline-block;
      width: 0.373333rem;
      height: 0.373333rem;
      background: url("../../static/img/search.png") no-repeat center;
      background-size: contain;
      vertical-align: text-top;
      margin-right: 0.133333rem;
    }
  }
}
</style>